package r25.board;

import r25.board.IBoard.CONTROL_DIRECTION;
import r25.board.IBoard.CONTROL_TYPE;

public class ControlMove {
	private final int position;
	private final CONTROL_DIRECTION controlDirection;
	private final CONTROL_TYPE controlType;

	public ControlMove(int position, CONTROL_DIRECTION controlDirection,
			CONTROL_TYPE controlType) {
		super();
		this.position = position;
		this.controlDirection = controlDirection;
		this.controlType = controlType;
	}

	public int getPosition() {
		return position;
	}

	public CONTROL_DIRECTION getControlDirection() {
		return controlDirection;
	}

	public CONTROL_TYPE getControlType() {
		return controlType;
	}

	@Override
	public String toString() {
		return controlType + ":" + position + ":" + controlDirection;
	}

	@Override
	public int hashCode() {
		return this.toString().hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if ((obj == null) || (this.getClass() != obj.getClass()))
			return false;

		ControlMove ro = (ControlMove) obj;
		return this.toString().equals(ro.toString());
	}
}
